package com.kiko.education.model;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Course {
    private int courseID;
    private String courseName;
    private String courseTeacher;
    private String courseDate;
    private String courseRoom;
    private Date startDate;
    private Date endDate;
    private int courseNums;
    private int selectNums;
    private double aveScore;
    private String courseFile;


    // Getters
    public int getCourseID() {
        return courseID;
    }

    public String getCourseName() {
        return courseName;
    }

    public String getCourseTeacher() {
        return courseTeacher;
    }

    public String getCourseDate() {
        return courseDate;
    }

    public String getCourseRoom() {
        return courseRoom;
    }

    public Date getStartDate() {
        return startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public int getCourseNums() {
        return courseNums;
    }

    public int getSelectNums() {
        return selectNums;
    }

    public double getAveScore() {
        return aveScore;
    }

    public String getCourseFile() {
        return courseFile;
    }

    // Setters
    public void setCourseID(int courseID) {
        this.courseID = courseID;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public void setCourseTeacher(String courseTeacher) {
        this.courseTeacher = courseTeacher;
    }

    public void setCourseDate(String courseDate) {
        this.courseDate = courseDate;
    }

    public void setCourseRoom(String courseRoom) {
        this.courseRoom = courseRoom;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public void setCourseNums(int courseNums) {
        this.courseNums = courseNums;
    }

    public void setSelectNums(int selectNums) {
        this.selectNums = selectNums;
    }

    public void setAveScore(double aveScore) {
        this.aveScore = aveScore;
    }

    public void setCourseFile(String courseFile) {
        this.courseFile = courseFile;
    }

    // toString method
    public String toString() {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

        return "Course{" +
                "courseID=" + courseID +
                ", courseName='" + courseName + '\'' +
                ", courseTeacher='" + courseTeacher + '\'' +
                ", courseDate='" + courseDate + '\'' +
                ", courseRoom='" + courseRoom + '\'' +
                ", startDate=" + (startDate != null ? dateFormat.format(startDate) : null) +
                ", endDate=" + (endDate != null ? dateFormat.format(endDate) : null) +
                ", courseNums=" + courseNums +
                ", selectNums=" + selectNums +
                ", aveScore=" + aveScore +
                ", courseFile='" + courseFile + '\'' +
                '}';
    }
}
